package com.jd.service;

import com.jd.entity.School;
import com.jd.mapper.SchoolMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SchoolServiceImpl implements SchoolService{
@Autowired
private SchoolMapper schoolMapper;
    @Override
    public List<School> getAllSchools() {
        return schoolMapper.getAllSchools();
    }

    @Override
    public List<School> getSchoolByName(String SchoolName) {
        return schoolMapper.getSchoolByName(SchoolName);
    }

    @Override
    public School getSchoolById(int id) {
        return schoolMapper.getSchoolById( id);
    }

    @Override
    public int deleteSchoolById(int id) {
        return schoolMapper.deleteSchoolById(id);
    }

    @Override
    public int insertSchool(School school) {
        return schoolMapper.insertSchool(school);
    }

    @Override
    public int updateSchool(School school) {
        return schoolMapper.updateSchool( school);
    }
}
